<?php

use Phinx\Migration\AbstractMigration;

class ModifyOrderPriceColumn extends AbstractMigration
{

    public function up()
    {
        $this->table("order")
            ->changeColumn("money", "decimal", [
                'default' => "0.00",
                'null' => false,
                'signed' => false,
                'precision' => 19,
                'scale' => 2,
                'comment' => "任务单价",
            ])
            ->changeColumn("man_day", "decimal", [
                'default' => "0.00",
                'null' => false,
                'signed' => false,
                'precision' => 19,
                'scale' => 2,
                'comment' => "人日单价",
            ])
            ->save();
    }

    public function down()
    {
        $this->table("order")
            ->changeColumn("money", "char", [
                    'default' => '',
                    'null' => false,
                    'limit' => 16,
                    'comment' => '任务单价']
            )
            ->changeColumn("man_day", "char", [
                    'default' => '',
                    'limit' => 8,
                    'comment' => '人日单价'
                ]
            )
            ->save();
    }
}
